package com.ruicar.afs.cloud.basic.creditchange.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruicar.afs.cloud.basic.common.entity.BasicContractCustRelation;
import com.ruicar.afs.cloud.basic.common.entity.BasicMainInfo;
import com.ruicar.afs.cloud.basic.common.service.BasicCustBaseInfoService;
import com.ruicar.afs.cloud.basic.common.service.BasicMainInfoService;
import com.ruicar.afs.cloud.basic.creditchange.condition.QueryContractListCondition;
import com.ruicar.afs.cloud.basic.creditchange.vo.ContractBasicListVO;
import com.ruicar.afs.cloud.basic.creditchange.vo.OldCustInfoVO;
import com.ruicar.afs.cloud.common.aspect.DataAccess;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import com.ruicar.afs.cloud.common.modules.contract.enums.ContractStatusEnum;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * @Author chuke
 * @create 2020/6/29 10:41
 * 查询合同案件列表
 */
@Slf4j
@RestController
@RequestMapping("/contractList")
@AllArgsConstructor
public class ContractListChangeController {
    private final BasicMainInfoService basicMainInfoService;
    private final BasicCustBaseInfoService basicCustBaseInfoService;

    @ApiOperation(value = "多条件查询已激活案件列表")
    @PostMapping(value = "/findActivatedContractList")
    public IResponse<IPage<List<ContractBasicListVO>>> findActivatedContractList(@RequestBody QueryContractListCondition qclc) {
//        Page page = new Page(qclc.getPageNumber(), qclc.getPageSize());
//        IPage<List<ContractBasicListVO>> voList = basicMainInfoService.findActivatedContractList(page, qclc);

        return IResponse.success(null);
    }

    @ApiOperation(value = "查询客户信息")
    @PostMapping(value = "/findCustRole")
    public IResponse<List<OldCustInfoVO>> findCustRole(@RequestParam("contractNo") String contractNo) {
        //客户信息
        return new IResponse().setData(basicCustBaseInfoService.queryCustInfo(contractNo));
    }

}
